﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using HZ.Supervise.IBLL;
using System.Data;

namespace HZ.Supervise.Web.Message
{
    public partial class msgAlert : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 获取提醒内容
        /// </summary>
        /// <returns></returns>
        protected string GetAlertContent()
        {

            StringBuilder strMessage = new StringBuilder();
            string strOrgId = CurrentAccount.GetUser().Org.OrgID;
            IBLL_MessageTypeDetail messageCtrl = new BLL.BLL_MessageTypeDetail();
            DataTable alertList = messageCtrl.GetMessagSendAll(CurrentAccount.GetUser().Org.OrgID);
           for (int i = 0; i < alertList.Rows.Count; i++)
			{
                strMessage.Append("<a href='../Message/MessageListForTypeAll.aspx' id='yujing' >");
                strMessage.Append("<span style='line-height:150%;color:red;text-decoration: none;'>");
                strMessage.Append("您有 <b>" + alertList.Rows[i]["count"].ToString() + "</b> 条" + alertList.Rows[i]["Level"].ToString() + "待查看");
                strMessage.Append("</span><br>");
			}

           //手动查看提醒，若没有提醒，则弹出说明信息。
           if (alertList.Rows.Count == 0 && Request.QueryString["from"] == "head")
           {
               strMessage.Append("<span style='line-height:150%;color:red;text-decoration: none;'>暂时没有提醒。</span><br>");
           }

            return strMessage.ToString();

        }
    }
}
